/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evangelion.core.daoImpl;

import com.evangelion.core.bean.Meses;
import com.evangelion.core.dao.MesesDao;
import java.util.List;
import javax.persistence.Query;
import org.springframework.stereotype.Component;

/**
 *
 * @author Kellycasma
 */
@Component
public class MesesDaoImpl extends AbstractDAO implements MesesDao {

    @Override
    public List<Meses> searchByParam(int start, int max) {
        Query q = em.createQuery("SELECT m FROM Meses m");
        q.setFirstResult(start);
        q.setMaxResults(max);
        return q.getResultList();
    }

    @Override
    public int countPage() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void save(Meses mes) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public List<Meses> searchByParamdesde(int desde, int hasta) {
        Query q = em.createQuery("SELECT m FROM Meses m WHERE m.id>=:desde AND m.id<=:hasta");
        q.setParameter("desde", desde);
        q.setParameter("hasta", hasta);
        return q.getResultList();
    }
}
